<?php

class Core_Form_Admin_Mail_Transport extends Form
{
	function init()
	{
		$this -> addChild('text', 'from_name', array(
			'label' => 'From name',
			'required' => true,
			'rules' => array('required')
		));

		$this -> addChild('email', 'from_mail', array(
			'label' => 'From address',
			'required' => true,
			'rules' => array('required'),
		));

		$this -> addChild('radio', 'protocol', array(
			'label' => 'Protocol',
			'multiOptions' => array(
				'smtp' => 'SMTP',
				'mail' => 'Built-in send mail function'
			),
			'value' => 'mail',
			'rules' => 'required',
		));

		$this -> addChild('text', 'smtpHost', array('label' => 'SMTP Host'));

		$this -> addChild('text', 'smtpPort', array('label' => 'SMTP Port'));

		$this -> addChild('text', 'smtpUsername', array('label' => 'SMTP Username'));

		$this -> addChild('text', 'smtpPassword', array('label' => 'SMTP Password'));

		$this -> addChild('radio', 'smtpSecure', array(
			'label' => 'SMTP Secure',
			'multiOptions' => array(
				'none' => 'None',
				'ssl' => 'SSL',
				'tsl' => 'TSL',
			),
			'value' => 'none',
		));

		$this -> addChild('group', 'buttons');

		$this -> buttons -> addChild('submit', '_submit') -> addChild('submit', '_test', array('label' => 'Test Transport')) -> addChild('cancel', '_cancel');
	}

}
